﻿#include <pthread.h>
#include "videoControl.h"
#include "task/task_mgr.h"
//-------------------------------------------------------------------------
mv::VideoControlMgr *mv::VideoControlMgr::_VideoControlMgr = nullptr;
std::mutex db_mx;

//-------------------------------------------------------------------------
mv::VideoControlMgr *
mv::VideoControlMgr::getSingleton(void)
{
	if (!_VideoControlMgr)
	{
		std::lock_guard<std::mutex> locker(db_mx);
		_VideoControlMgr = new mv::VideoControlMgr;
	}
	return _VideoControlMgr;
}

//-------------------------------------------------------------------------
void mv::VideoControlMgr::destroyInstance(void)
{
	if (_VideoControlMgr)
	{
		std::lock_guard<std::mutex> locker(db_mx);
		delete _VideoControlMgr;
		_VideoControlMgr = nullptr;
	}
}

//-------------------------------------------------------------------------
mv::VideoControlMgr::VideoControlMgr()
{
	//_serialMgr = nullptr;
	m_threadPoor = new ThreadPool(1);
}

//-------------------------------------------------------------------------
mv::VideoControlMgr::VideoControlMgr(const VideoControlMgr &)
{
	//delete _serialMgr;
}

int mv::VideoControlMgr::initCarWindowInterface(int iDirection) {
	if (_videoMgr == nullptr) {
		_videoMgr = new VideoMgr(iDirection);
	}
	return 1;
}

void mv::VideoControlMgr::startCarWindowProcess() {
	if (_videoMgr != nullptr) {

	}
}

void mv::VideoControlMgr::stopCarWindowProcess() {
	if (_videoMgr != nullptr) {

	}
}

void mv::VideoControlMgr::startIrisCameraPreview() {
	if (_videoMgr != nullptr) {

	}
}

void mv::VideoControlMgr::stopIrisCameraPreview() {
	if (_videoMgr != nullptr) {

	}
}